Update dependency net.sourceforge.pmd:pmd-core to v7.22.0 [SECURITY]#104
Open
xdev-renovate wants to merge 1 commit intodevelopfrom
Open
Update dependency net.sourceforge.pmd:pmd-core to v7.22.0 [SECURITY]#104xdev-renovate wants to merge 1 commit intodevelopfrom
xdev-renovate wants to merge 1 commit intodevelopfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
7.20.0→7.22.0GitHub Vulnerability Alerts
CVE-2026-28338
Summary
PMD's
vbhtmlandyahtmlreport formats insert rule violation messages into HTML output without escaping. When PMD analyzes untrusted source code containing crafted string literals, the generated HTML report contains executable JavaScript that runs when opened in a browser.While the default
htmlformat is not affected via rule violation messages (it correctly usesStringEscapeUtils.escapeHtml4()), it has a similar problem when rendering suppressed violations. The user supplied message (the reason for the suppression) was not escaped.Details
VBHTMLRenderer.javaline 71 appendsrv.getDescription()directly into HTML:YAHTMLRenderer.javalines 196–203 does the same viarenderViolationRow():Called at line 172:
The violation message originates from
AvoidDuplicateLiteralsRule.javaline 91, which embeds raw string literal values viafirst.toPrintableString(). This callsStringUtil.escapeJava()(line 476–480), which is a Java source escaper — it passes<,>, and&through unchanged because they are printable ASCII (0x20–0x7e).By contrast,
HTMLRenderer.javaline 143 properly escapes:PoC
vbhtmlformat:report.htmlin a browser. A JavaScript alert executes showingdocument.domain.The generated HTML contains the unescaped tag:
Tested and confirmed on PMD 7.22.0-SNAPSHOT (commit bcc646c53d).
Impact
Stored cross-site scripting (XSS). Affects CI/CD pipelines that run PMD with
--format vbhtmlor--format yahtmlon untrusted source code (e.g., pull requests from external contributors) and expose the HTML report as a build artifact. JavaScript executes in the browser context of anyone who opens the report.Practical impact is limited because
vbhtmlandyahtmlare legacy formats rarely used in practice. The defaulthtmlformat has a similar issue with user messages from suppressed violations.Fixes
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.